/*
 * @Author: 来自火星的码农 15122322+heyzhi@user.noreply.gitee.com
 * @Date: 2025-10-12 20:07:36
 * @LastEditors: 来自火星的码农 15122322+heyzhi@user.noreply.gitee.com
 * @LastEditTime: 2025-10-30 14:20:32
 * @FilePath: /GateServer/src/service/Userservice.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#pragma once
#include <jsoncpp/json/value.h>
#include <memory>
#include <string>
#include "../validator/registervalidator.h"
#include "../mysql/mysqlmgr.h"
#include "../util/util.h"
#include "../validator/validator.h"
namespace Yizhi {
    
    struct Result{
        bool success;
        Ecode err_code;
        int uid;
        std::string message;
        Json::Value toJsonstirng();

    };


    class Userservice{
        public:
        Userservice(std::shared_ptr<Validator> validator);

        Result registeruser(const User& user);
        Result resetpsw(const User&user);
        Result login(User&user);
        private:
        std::shared_ptr<Validator> m_validator;

    };
}